package com.dimeng.utils;

import java.lang.ref.SoftReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.dimeng.entity.Info;

/**
 * 程序静态缓存数据
 */
public class AppCache {
	/**行业资讯类别id，默认初始为0**/
	public static String infoCatId = "";
	
	public final static String PRICE = "price";//价格行情
	public final static String LAST_BUY = "lastBuy";//最新求购
	public final static String ENMERGENCY_BUY = "enmergencyBuy";//紧急求购
	public final static String TOP_BUY = "topBuy";//求购排行榜
	
	/**每个行业类别及其所对应的资讯list列表的Map集合**/
	public static Map<String,List<Info>> catIdInfoListMap = new HashMap<String, List<Info>>();
	
	/**资讯类别列表**/
	public static List<HashMap<String,String>> popupCatList = new ArrayList<HashMap<String,String>>();
	
	/**listView对应的第一个可视的item的位置**/
	public static Map<String,Integer> listViewFirstPostionMap = new HashMap<String,Integer>();
	
	public static final HashMap<Integer,String> SEARCH_TYPE_NAME_MAP = new HashMap<Integer, String>();
	
	static {
		listViewFirstPostionMap.put(PRICE, 0);
		listViewFirstPostionMap.put(LAST_BUY, 0);
		listViewFirstPostionMap.put(ENMERGENCY_BUY, 0);
		listViewFirstPostionMap.put(TOP_BUY, 0);
		
		SEARCH_TYPE_NAME_MAP.put(1, "产 品");
		SEARCH_TYPE_NAME_MAP.put(2, "公 司");
		SEARCH_TYPE_NAME_MAP.put(3, "求 购");
	}
	/**下一篇热点资讯的item位置**/
	public static int nextLocation = 0;
	
	/**输入的词-自动提示的词组，使用SoftReference缓存**/
	public static Map<String,SoftReference<List<String>>> autoCompleteKeywordMap = 
			new HashMap<String, SoftReference<List<String>>>();
	
	/**远程下载的过滤省份**/
	public static List<HashMap<String,String>> filterProvinces = new ArrayList<HashMap<String,String>>();
	/**远程下载的过滤地市**/
	public static List<HashMap<String,String>> filterCities = new ArrayList<HashMap<String,String>>();
	
	public static HashMap<String,List<HashMap<String,String>>> keyListMap = new HashMap<String,List<HashMap<String,String>>>();
	
	/**图片在相册中的位置**/
	public static int photoPosition = 0;
}
